import { defineStore } from 'pinia'
export const useUserStore = defineStore('user', {
  state: () => {
    return {
      name: '张三',
      age: 18,
      sex: '男'
    }
  
  },
  getters: {
    // 不可传参的getter
    getAddAge: state => {
      return state.age + 100
    },
    // 可传递参数的getter
    getAddAge1: state => {
        return (num: number) => state.age + num
      },
    getNameAndAge ():string {
      return this.name + this.getAddAge
    }
  }
  

})